home *** CD-ROM | disk | FTP | other *** search
/ Aminet 45 / Aminet 45 (2001)(GTI - Schatztruhe)[!][Oct 2001].iso / Aminet / game / role / ldmud-3.2-bin.lha / mud / doc / efun / mkmapping < prev    next >
Text File  |  2001-04-06  |  915b  |  24 lines

  1. SYNOPSIS
  2.         mapping mkmapping(mixed *arr1, mixed *arr2,...)
  3.  
  4. DESCRIPTION
  5.         Returns a mapping with indices from 'arr1' and values from
  6.         'arr2'... . arr1[0] will index arr2...[0], arr1[1] will index
  7.         arr2...[1], etc. If the arrays are of unequal size, the mapping
  8.         will only contain as much elements as are in the smallest
  9.         array.
  10.  
  11.         Normally, mappings are extended by simply inserting new elements.
  12.         This function is useful if you can estimate the needed size of
  13.         the mapping in advance, to reduce the malloc overhead. Any
  14.         unused allocated space will be freed after the current function
  15.         returns.
  16.  
  17. EXAMPLE
  18.         mkmapping( ({ 1, 2 }), ({ 10, 11 }), ({ 20, 21, 22}))
  19.           returns ([ 1:10;20, 2:11;21 ])
  20.  
  21. SEE ALSO
  22.         mappings(LPC), mappingp(E), m_indices(E), m_values(E),
  23.         m_delete(E), sizeof(E), widthof(E), unmkmapping(E).
  24.